<?php
//限制PHP版本 》 7.1
if(version_compare(PHP_VERSION,'7.1.0','<'))  die('require PHP > 7.1.0 !');

// 检查workman 要使用的函数是否被禁用
$flist = [
    'stream_socket_server',
    'pcntl_signal_dispatch',
    'pcntl_signal','pcntl_alarm',
    'pcntl_fork',
    'posix_getuid',
    'posix_getpwuid',
    'posix_kill',
    'posix_setsid',
    'posix_getpid',
    'posix_getpwnam',
    'posix_getgrnam',
    'posix_getgid',
    'posix_setgid',
    'posix_initgroups',
    'posix_setuid',
    'posix_isatty',
    'pcntl_wait',
];

$disabled = explode(',', ini_get('disable_functions'));
$disabled_fun_nums = 0;

foreach ($flist as $val){
    if(!function_exists($val)){  
        exit("$val :  does not exist\n");
        $disabled_fun_nums++;
    } 
    if(in_array($val, $disabled)){  
        exit("$val:  is disabled\n");
        $disabled_fun_nums++;
    } 
}
echo "ZTCP: check success! \n";




